import { object_Inf } from "@/utils/typings/index.type";
import request from "@/utils/request";
import productOrderManage_APi from "../productOrderManage";

/*
 * @Descripttion:系统管理接口
 * @LastEditors: xzh
 * @LastEditTime: 2023-10-10 20:38:44
 */
export default class systemManage_APi extends productOrderManage_APi {
  //#region 班组管理

  /**
   * @Author: xzh
   * @Descripttion:保存班组信息
   * @Param:
   * @param {object} data
   */
  static saveTeam = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Team/SaveTeam",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除班组信息
   * @Param:
   * @param {Array} data
   */
  static deleteTeam = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Team/DeleteTeam",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改班组状态
   * @Param:
   * @param {Array} data
   */
  static updateTeamStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/Team/UpdateTeamStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取班组信息
   * @Param:
   * @param {number} id 班组主键
   */
  static getTeamInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Team/GetTeamInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取班组列表
   * @Param:
   */
  static getTeamList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/Team/GetTeamList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  //#endregion

  //#region 仓库管理

  /**
   * @Author: xzh
   * @Descripttion:保存仓库信息
   * @Param:
   * @param {object} data
   */
  static saveStore = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Warehouse/SaveWarehouse",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除仓库信息
   * @Param:
   * @param {Array} data
   */
  static deleteStore = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Warehouse/DeleteWarehouse",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改仓库状态
   * @Param:
   * @param {Array} data
   */
  static updateStoreStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/Warehouse/UpdateWarehouseStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取仓库信息
   * @Param:
   * @param {number} id 仓库主键
   */
  static getStoreInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Warehouse/GetWarehouseInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取仓库分页列表
   * @Param:
   */
  static getStoreList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Warehouse/GetWarehouseList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 计量单位

  /**
   * @Author: xzh
   * @Descripttion:保存计量单位信息
   * @Param:
   * @param {object} data
   */
  static saveCalcUnit = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MeasureUnit/SaveMeasureUnit",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除计量单位信息
   * @Param:
   * @param {Array} data
   */
  static deleteCalcUnit = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MeasureUnit/DeleteMeasureUnit",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改计量单位状态
   * @Param:
   * @param {Array} data
   */
  static updateCalcUnitStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MeasureUnit/UpdateJobPostStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取计量单位信息
   * @Param:
   * @param {number} id 计量单位主键
   */
  static getCalcUnitInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MeasureUnit/GetMeasureUnitInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取计量单位分页列表
   * @Param:
   */
  static getCalcUnitList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MeasureUnit/GetMeasureUnitList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 工序定义

  /**
   * @Author: xzh
   * @Descripttion:保存工序定义信息
   * @Param:
   * @param {object} data
   */
  static saveProcessDefine = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Process/SaveProcess",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除工序定义信息
   * @Param:
   * @param {Array} data
   */
  static deleteProcessDefine = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Process/DeleteProcess",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取工序定义信息
   * @Param:
   * @param {number} id 工序定义主键
   */
  static getProcessDefineInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Process/GetProcessInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取工序定义列表
   * @Param:
   */
  static getProcessDefineList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/Process/GetProcessList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 供应商管理

  /**
   * @Author: xzh
   * @Descripttion:保存供应商信息
   * @Param:
   * @param {object} data
   */
  static saveSupplier = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Supplier/SaveSupplier",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除供应商信息
   * @Param:
   * @param {Array} data
   */
  static deleteSupplier = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Supplier/DeleteSupplier",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取供应商信息
   * @Param:
   * @param {number} id 供应商主键
   */
  static getSupplierInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Supplier/GetSupplierInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改供应商管理状态
   * @Param:
   * @param {Array} data
   */
  static updateSupplierStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/Supplier/UpdateSupplierStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取供应商分页列表
   * @Param:
   */
  static getSupplierPageList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/Supplier/GetSupplierList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 区域管理

  /**
   * @Author: xzh
   * @Descripttion:保存区域信息
   * @Param:
   * @param {object} data
   */
  static saveRegion = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Region/SaveRegion",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除区域信息
   * @Param:
   * @param {Array} data
   */
  static deleteRegion = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Region/DeleteRegion",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取区域信息
   * @Param:
   * @param {number} id 区域主键
   */
  static getRegionInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Region/GetRegionInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取区域分页列表
   * @Param:
   */
  static getRegionList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Region/GetRegionList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 客户类型

  /**
   * @Author: xzh
   * @Descripttion:保存客户类型信息
   * @Param:
   * @param {object} data
   */
  static saveCustomerType = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/CustomerType/SaveCustomerType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除客户类型信息
   * @Param:
   * @param {Array} data
   */
  static deleteCustomerType = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/CustomerType/DeleteCustomerType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取客户类型信息
   * @Param:
   * @param {number} id 客户类型主键
   */
  static getCustomerTypeInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/CustomerType/GetCustomerTypeInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取客户类型分页列表
   * @Param:
   */
  static getCustomerTypeList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/CustomerType/GetCustomerTypeList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 客户管理

  /**
   * @Author: xzh
   * @Descripttion:保存客户信息
   * @Param:
   * @param {object} data
   */
  static saveCustomer = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Customer/SaveCustomer",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除客户信息
   * @Param:
   * @param {Array} data
   */
  static deleteCustomer = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Customer/DeleteCustomer",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取客户信息
   * @Param:
   * @param {number} id 客户主键
   */
  static getCustomerInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Customer/GetCustomerInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取客户列表
   * @Param:
   */
  static getCustomerList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/Customer/GetCustomerList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 产品类型

  /**
   * @Author: xzh
   * @Descripttion:保存产品类型信息
   * @Param:
   * @param {object} data
   */
  static saveProductClassify = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/ProductType/SaveProductType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除产品类型信息
   * @Param:
   * @param {Array} data
   */
  static deleteProductClassify = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/ProductType/DeleteProductType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取产品类型信息
   * @Param:
   * @param {number} id 产品类型主键
   */
  static getProductClassifyInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/ProductType/GetProductType",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取产品类型分页列表
   * @Param:
   */
  static getProductClassifyList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductType/GetProductTypeList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 产品管理

  /**
   * @Author: xzh
   * @Descripttion:保存产品信息
   * @Param:
   * @param {object} data
   */
  static saveProduct = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/ProductInfo/SaveProductInfo",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除产品信息
   * @Param:
   * @param {Array} data
   */
  static deleteProduct = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/ProductInfo/DeleteProductInfo",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改产品状态
   * @Param:
   * @param {Array} data
   */
  static updateProductStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductInfo/UpdateProductInfoStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取产品信息
   * @Param:
   * @param {number} id 产品主键
   */
  static getProductInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/ProductInfo/GetProductInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取产品列表
   * @Param:
   */
  static getProductList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductInfo/GetProductInfoList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 执行规则

  /**
   * @Author: xzh
   * @Descripttion:保存执行规则信息
   * @Param:
   * @param {object} data
   */
  static saveExecuteRule = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/ExecuteRule/SaveExecuteRule",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除执行规则信息
   * @Param:
   * @param {Array} data
   */
  static deleteExecuteRule = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/ExecuteRule/DeleteExecuteRule",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改执行规则状态
   * @Param:
   * @param {Array} data
   */
  static updateExecuteRuleStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/ExecuteRule/UpdateExecuteRuleStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取执行规则信息
   * @Param:
   * @param {number} id 执行规则主键
   */
  static getExecuteRuleInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/ExecuteRule/GetExecuteRuleInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取执行规则分页列表
   * @Param:
   */
  static getExecuteRuleList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/ExecuteRule/GetExecuteRuleList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 存放设置接口

  /**
   * @Author: xzh
   * @Descripttion:保存存放位置信息
   * @Param:
   * @param {object} data
   */
  static savePosition = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/Position/SavePosition",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除存放位置信息
   * @Param:
   * @param {Array} data
   */
  static deletePosition = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/Position/DeletePosition",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改存放位置状态
   * @Param:
   * @param {Array} data
   */
  static updatePositionStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/Position/UpdatePositionStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取存放位置信息
   * @Param:
   * @param {number} id 存放位置主键
   */
  static getPositionInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/Position/GetPosition",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取存放位置列表
   * @Param:
   */
  static getPositionList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/Position/GetPositionPageList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 保养级别
  /**
   * @Author: xzh
   * @Descripttion:保存保养级别信息
   * @Param:
   * @param {object} data
   */
  static saveUpkeepLevel = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MaintenanceLevel/SaveMaintenanceLevel",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除保养级别信息
   * @Param:
   * @param {Array} data
   */
  static deleteUpkeepLevel = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MaintenanceLevel/DeleteMaintenanceLevel",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改保养级别状态
   * @Param:
   * @param {Array} data
   */
  static updateUpkeepLevelStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MaintenanceLevel/UpdateMaintenanceLevel",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取保养级别信息
   * @Param:
   * @param {number} id 保养级别主键
   */
  static getUpkeepLevelInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MaintenanceLevel/GetMaintenanceLevel",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取保养级别列表
   * @Param:
   */
  static getUpkeepLevelList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MaintenanceLevel/GetMaintenanceLevelPageList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  //#endregion
}
